package com.hnit.configs;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;

@Data
@Document(indexName = "product")
public class ProductEs {

    @Id
    private Long productId;

    @Field(type = FieldType.Keyword)
    private Long categoryId;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String productName;

    @Field(type = FieldType.Keyword)
    private String mainImage;

    @Field(type = FieldType.Keyword)
    private String subImages;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String detail;

    @Field(type = FieldType.Scaled_Float, scalingFactor = 100)
    private BigDecimal price;

    @Field(type = FieldType.Scaled_Float, scalingFactor = 100)
    private BigDecimal originalPrice;

    @Field(type = FieldType.Integer)
    private Integer productStatus;

    @Field(type = FieldType.Keyword)
    private String categoryName;

    // Getter and Setter methods
}